package com.zx.idc.backend.gui.common;

import com.zx.idc.ds.common.entity.BaseEntity;
import com.zx.idc.ds.common.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Optional;

/**
 *
 * 调用Mongodb数据库 Api基类
 * @param <Service> 服务层的类
 * @param <Entity> 实体类
 */
public class MongoBaseApi <Service, Entity> extends BaseApi {
    /**
     * 自动注入业务类的 Bean
     */
    @SuppressWarnings({"SpringJavaInjectionPointsAutowiringInspection"})
    @Autowired
    protected Service service;


    public Optional<Service> getService() {
        return Optional.of(service);
    }

}
